package com.baosight.ice.observer;

import com.alibaba.fastjson.JSONObject;
import com.zeroc.Ice.Current;
import com.zeroc.IceGrid.RegistryInfo;
import com.zeroc.IceGrid.RegistryObserver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;

public class RegistryObserverI implements RegistryObserver {
    public static Logger logger = LoggerFactory.getLogger(RegistryObserverI.class);
    @Override
    public void registryInit(RegistryInfo[] registryInfos, Current current) {
        System.out.println("registryInit " + Arrays.stream(registryInfos).map(JSONObject::toJSONString));
    }

    @Override
    public void registryUp(RegistryInfo registryInfo, Current current) {
        System.out.println("registryUp "+registryInfo);
    }

    @Override
    public void registryDown(String s, Current current) {
        System.out.println("registryDown "+s);
    }
}
